home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat España 15
/
macformat_15.iso
/
C de cerca
/
Codewarrior Lite
/
MacOS Support
/
Headers
/
ANSI Headers
/
stdlib.h
< prev
next >
Wrap
Text File
|
1995-12-29
|
4KB
|
149 lines
/* stdlib.h standard header */
#ifndef _STDLIB
#define _STDLIB
#ifndef _YVALS
#include <yvals.h>
#endif
#if __MWERKS__
#pragma options align=mac68k
#if __CFM68K__ && __USING_IMPORTED_ANSI__
#pragma import on
#endif
#endif
#if __MWERKS__ && !defined(_INLINE_CPU_CALLS_) && __POWERPC__
#define _INLINE_CPU_CALLS_ 1 /* on by default with PPC */
#endif
/* macros */
#ifndef NULL
#define NULL _NULL
#endif
#define EXIT_FAILURE _EXFAIL
#define EXIT_SUCCESS 0
#define MB_CUR_MAX _Mbcurmax
#define RAND_MAX 32767
/* type definitions */
#ifndef _SIZET
#define _SIZET
typedef _Sizet size_t;
#endif
#ifndef _WCHART
#define _WCHART
typedef _Wchart wchar_t;
#endif
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef int _Cmpfun(const void *, const void *);
/* declarations */
_EXTERN_C /* low-level functions */
int atexit(void (*)(void));
void exit(int);
#if __MWERKS__
int _atexit(void (*)(void));
void _exit(int);
#endif
char *getenv(const char *);
int system(const char *);
_END_EXTERN_C
_C_LIB_DECL
void abort(void);
#if __MWERKS__ && !__POWERPC__
int abs(int);
#endif
void *bsearch(const void *, const void *, size_t, size_t,
_Cmpfun *);
void *calloc(size_t, size_t);
div_t div(int, int);
void free(void *);
#if __MWERKS__ && !__POWERPC__
long labs(long);
#endif
ldiv_t ldiv(long, long);
void *malloc(size_t);
int mblen(const char *, size_t);
size_t mbstowcs(wchar_t *, const char *, size_t);
int mbtowc(wchar_t *, const char *, size_t);
void qsort(void *, size_t, size_t, _Cmpfun *);
int rand(void);
void *realloc(void *, size_t);
long strtol(const char *, char **, int);
size_t wcstombs(char *, const wchar_t *, size_t);
int wctomb(char *, wchar_t);
double _Stod(const char *, char **, long);
float _Stof(const char *, char **, long);
int _Stoflt(const char *, char **, long[], int);
long double _Stold(const char *, char **, long);
unsigned long _Stoul(const char *, char **, int);
extern char _Mbcurmax;
extern unsigned long _Randseed;
_END_C_LIB_DECL
/* inlines, for C++ */
#ifdef __cplusplus
inline double atof(const char *_S)
{return (_Stod(_S, 0, 0)); }
inline int atoi(const char *_S)
{return ((int)_Stoul(_S, 0, 10)); }
inline long atol(const char *_S)
{return ((long)_Stoul(_S, 0, 10)); }
inline void srand(unsigned int _Seed)
{_Randseed = _Seed; }
inline double strtod(const char *_S, char **_Endptr)
{return (_Stod(_S, _Endptr, 0)); }
inline unsigned long strtoul(const char *_S, char ** _Endptr,
int _Base)
{return (_Stoul(_S, _Endptr, _Base)); }
#if __MWERKS__ && __POWERPC__
inline int abs(int x) { return (__abs(x)); }
inline long labs(long x) { return (__labs(x)); }
#endif
#else
/* declarations and macro overrides, for C */
double atof(const char *);
int atoi(const char *);
long atol(const char *);
void srand(unsigned int);
double strtod(const char *, char **);
unsigned long strtoul(const char *, char **, int);
#define atof(s) _Stod(s, 0, 0)
#define atoi(s) (int)_Stoul(s, 0, 10)
#define atol(s) (long)_Stoul(s, 0, 10)
#define srand(seed) (void)(_Randseed = (seed))
#define strtod(s, endptr) _Stod(s, endptr, 0)
#define strtoul(s, endptr, base) _Stoul(s, endptr, base)
#if __MWERKS__ && __POWERPC__
int abs(int);
long labs(long);
#define abs(x) __abs(x)
#define labs(x) __labs(x)
#endif
#endif /* __cplusplus */
#if __MWERKS__
#if __CFM68K__ && __USING_IMPORTED_ANSI__
#pragma import reset
#endif
#pragma options align=reset
#endif
#endif /* _STDLIB */
/*
* Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
*/
/* Change log:
*94June04 PlumHall baseline
*94Oct07 Inserted MW changes.
*/